package com.me.chat.controller.bis.relation;

import com.me.chat.pojo.relation.SingleRelation;
import com.me.chat.pojo.relation.qo.SingleRelationQO;
import com.me.chat.pojo.suport.ResultBean;
import com.me.chat.service.relation.SingleRelationService;
import com.me.chat.util.stauts.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Authhor: qiu
 * @Date: 2021/12/18 2:34 下午
 */

@RestController
@RequestMapping("/res/single_relation")
public class SingleRelationController {

    @Autowired
    SingleRelationService singleRelationService;

    /**
     * 联系人(通讯录)查询
     * @param singleRelationQO
     * @return
     */
    @GetMapping("/search")
    public ResultBean<List<SingleRelation>> getSingleRelationList(SingleRelationQO singleRelationQO) {
        List<SingleRelation> singleRelations = singleRelationService.selSingleRelation(singleRelationQO);
        return new ResultBean(StatusCode.SUCCEED,singleRelations,"联系人查询");
    }
}
